//main.cpp
#include <iostream>
#include <opencv2/opencv.hpp>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

using namespace cv;
using namespace cv::cuda;
extern void swap_rb(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null());
int main()
{
    Mat image = imread("D:\\1.png");
    imshow("src", image);
    GpuMat gpuMat, output;

    gpuMat.upload(image);
    swap_rb(gpuMat, output);
    output.download(image);

    imshow("gpu", image);
    waitKey(0);
    return 0;
}